<?php include_once("../../../common/common_setting_unit.php");         // 引入通用的设置文件 ?>
<?php include_once(ROOT_PATH_ . "/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("../controller/data_schedule_window.php");                     // 当前页面的控制器 ?>



<body>


    <?
    //==============================================================================
    //这里开始才是平常开发需要注重的部分，其余的基本不用理会
    //==============================================================================
    ?>

    <div id="window">

            <!--标题设定-->
            <?php $page_title='编辑';?>
            <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>





           <div class="detail-box">


               <ul class="detail-boxing">
                   <form id="data_form" method="post" class="layui-form"
                         action ="data_update_schedule_process.php?<? echo $url_parameter ?>"
                         enctype="multipart/form-data">

                       <input type="hidden"  name="product_name" value="<? echo $order_data['title']?>" >
                       <input type="hidden"  name="startdate"    value="<? echo $order_data['startdate']?>" >
                       <input type="hidden"  name="enddate"      value="<? echo $order_data['enddate']?>" >
                       <input type="hidden"  name="order_nid"     value="<? echo $_REQUEST['nid']?>"/>


                       <table class="layui-table">
                            <thead>
                           <tr>
                               <th>套餐:<? echo $order_data['title'] ?></th>
                               <th> </th>
                               <th>数量: <? echo $order_data['amount'] ?></th>
                               <th></th>
                               <th>日期:<? echo $order_data['startdate'] ?> - <? echo $order_data['enddate'] ?></th>
                               <th></th>
                           </tr>
                           <tr>
                               <th>学生:<? echo $data[0]['name'] ?></th>
                               <th> </th>
                               <th>班别: <? echo $data[0]['school'] ?>
                                   <? echo $data[0]['grade'] ?>
                                   <? echo $data[0]['class_'] ?>
                               </th>
                               <th></th>
                               <th> </th>
                               <th></th>
                           </tr>
                           </thead>

                       </table>


                       <!--标题设定-->
                       <?php $page_title='配送日程';?>
                       <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>

                       <blockquote class="layui-elem-quote">过期未配送：下单时间在当日或此日期之后，旧订单为【T+1未配送】</blockquote>


                       <table class="layui-table">
                           <thead>
                           <tr>
                               <th>配送日期</th>
                               <th>星期</th>
                               <th>产品</th>
                               <th>状态</th>
                               <th>备注</th>
                               <th>操作</th>
                           </tr>
                           </thead>
                           <tbody>


<?php foreach ($data as $key=>$value){
     $date_str = $value['ondate'] ;
     $date_week_str = date("w", strtotime($value['ondate']) );
?>

    <td>
        <input type="hidden" name="nid[<?= $value['nid'] ?>]" value="<? echo $value['nid']?>"/>

        <input type="input" name="date[<?= $value['nid'] ?>]" js-data="<?= $date_str ?>"
               class="laydate_date layui-input"
               value="<?= substr($value['ondate'],0,10) ?>">
    </td>



            <td>
                <!--js动态更新，根据-->
                <?= $week_array[$date_week_str] ?></td>
            <td>
                <?foreach ($milk_checked_list as $key2=>$value2){?>
                    <input type="radio" class="layui-input"  name="milk[<?= $value['nid'] ?>]"

                        <?if($milk_schdule_list_1darray[$date_str] == $value2){echo "checked";}?>

                           value="<? echo $value2 ?>"
                           title="<? echo $value2 ?>">
                    <?;}?>
<!--                <input type="radio" class="layui-input"-->
<!--                    --><?//if($milk_schdule_list_1darray[$date_str] == ""){echo "checked";}?>
<!--                       name="milk[--><?//= $date_str ?><!--]" value='' title='取消'"/>-->

            </td>
            <td> <?echo $value['status']?></td>
            <td><input type="text" class="layui-input" name="remark[<?= $value['nid'] ?>]" value="<?echo $value['remark']?>" ></td>
            <td>
                <a href="data_refund_window.php?nid=<? echo $_REQUEST['nid']?>&date=<? echo $date_str ?>">退款</a>
            </td>

        </tr>
<?php;} ?>


                           </tbody>
                       </table>



<br/>
<br/>
<br/>
<br/>






                       <div class="function">

                           <button class="layui-btn"  lay-submit type="submit" >立即提交</button>
                           <input type="reset" class="layui-btn" value="重置"/>
                       </div>



                   </form>
               </ul>
           </div>
        </div>



        <?
        //==============================================================================
        //这里上面才是平常开发需要注重的部分，下面的基本不用理会，只有底部JS部分需要根据实际情况去加载
        //==============================================================================
        ?>



            </div>
            <!--detail-box end-->


</div>
<!--content端點01-->
<?
//==============================================================================
//这里上面才是平常开发需要注重的部分，下面的基本不用理会，只有底部JS部分需要根据实际情况去加载
//==============================================================================
?>





<br class="clearfloat"/>
<!--container-->
</div>




<!--底部栏-->
<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
<!--返回顶部 按钮-->
<script type="text/javascript" src="/controller/common/asset/js/scrool_top.js"></script>


</body>
</html>
